package com.itheima.service.impl;

import com.itheima.mapper.MemberMapper;
import com.itheima.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberMapper memberMapper;


    /**
     * 会员数量统计
     *
     * @return
     */
    public List<Integer> findMemberCountByMonths(List<String> months) {
        List<Integer> membercountlist = new ArrayList<>();
        for (String month : months) {

            Integer membercount = memberMapper.getMemberCountByMonths(month);
            membercountlist.add(membercount);
        }

        return membercountlist;
    }
}
